#include<stdio.h>
#include<unistd.h>
#include<string.h>

#define NUM 101

int main()
{
  char bar[NUM];
  memset(bar,0,sizeof(bar));
  const char* label = "|/-\\";
  int cnt = 0;
  while(cnt < 100)
  {
    bar[cnt++] = '#';
    printf("[%-100s][%d%%] %c\r",bar,cnt,label[cnt%4]);
    fflush(stdout);
    usleep(60000);
  }
  printf("\n");
  return 0;
}
